package com.ysstech.common.enums;

import java.util.Arrays;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 删除状态的标识
 *
 * @author lsl
 */
@Getter
@AllArgsConstructor
public enum YssStatusEnum implements BaseEnum<Integer> {
    YSS_NORMAL(1, "正常"),
    YSS_WAITING_REVIEW(2, "等待审核"),
    YSS_FAIL_REVIEW(3, "审核不通过"),
    YSS_UNDER_REVIEW(4, "审核中"),
    YSS_DELETED(5, "已删除");

    private final Integer code;
    private final String desc;

    public static YssStatusEnum getEnum(Integer code) {
        return Arrays.stream(values()).filter(b -> b.code == code).findFirst().orElse(null);
    }

    public static String getEnumDesc(Integer code) {
        YssStatusEnum e = getEnum(code);
        return e != null ? e.desc : null;
    }
}
